package com.sso.login.servie.impl;

import com.sso.login.mapper.LoginMapper;
import com.sso.login.pojo.User;
import com.sso.login.servie.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Rocky
 * @create 2023-04-02 10:47
 */
@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private LoginMapper loginMapper;


    @Override
    public User queryUser(String userName, String userPwd) {
        User user= loginMapper.queryUser(userName,userPwd);
        if (user == null ){
            return null;
        }
        if (user.getUserName().equals(userName) && user.getUserPwd().equals(userPwd)){
            return user;
        }
        return null;
    }
}
